package com.yu.shortlink.project.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yu.shortlink.project.dao.entity.ShortLinkDO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
* @author 哈哈哈呜呜呜
* @description 针对表【t_link】的数据库操作Mapper
* @createDate 2024-04-23 09:47:04
* @Entity com.yu.shortlink.project.dao.entity.LinkDO
*/
public interface ShortLinkMapper extends BaseMapper<ShortLinkDO> {

    /**
     * 短链接统计自增
     */
    @Update("update t_link set total_pv = total_pv+#{totalPv},total_uv = total_uv+#{totalUv},total_uip = total_uip+#{totalUip} where gid = #{gid} and full_short_url = #{fullShortUrl}")
    void incrementStats(@Param("gid") String gid, @Param("fullShortUrl") String fullShortUrl, @Param("totalPv") Integer totalPv, @Param("totalUv") Integer totalUv, @Param("totalUip") Integer totalUip);;

}




